package com.reggie.utils;

/**
 * @Author 早睡蛋
 * @Date 2022/9/20 20:41:53
 * @Desc:
 * ThreadLocal封装工具类
 * 用于获取用户线程id
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId(){
        return threadLocal.get();
    }

}
